const Service = require('egg').Service;
class UserService extends Service {
    async getBudget() {
        try {
            const sql = `SELECT budget FROM user WHERE id ='admin'`;
            const data = await this.app.mysql.query(sql);
            return data[0];
        } catch (err) {
            this.ctx.throw(this.app.config.code.ERROR, err);
        }
    }
}

module.exports = UserService;